package com.training.entity;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Set;


/**
 * The persistent class for the emp_information database table.
 * 
 */
@Entity
@Table(name="emp_information")
@NamedQuery(name="getEmployeeInfo",query="Select el from EmpInformation el where el.email = :emailInput")
public class EmpInformation implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="emp_id")
	private String empId;

	private byte active;

	private String email;

	@Column(name="emp_first_name")
	private String empFirstName;

	@Column(name="emp_last_name")
	private String empLastName;

	@Column(name="emp_middle_name")
	private String empMiddleName;

	@Column(name="login_attempts")
	private byte loginAttempts;

	private String manager;

	private String password;

	@Column(name="secondry_email")
	private String secondryEmail;

	@OneToOne(mappedBy="employeeInformation" , cascade = CascadeType.ALL,fetch=FetchType.EAGER)
	private EmpPayroll  empPayroll;
	 
	 
	public EmpPayroll getEmpPayroll() {
		return empPayroll;
	}

	public void setEmpPayroll(EmpPayroll empPayroll) {
		this.empPayroll = empPayroll;
	}

	//bi-directional many-to-many association to Project
	@ManyToMany(mappedBy="employeeInformations", fetch = FetchType.LAZY)
	private Set<Project> projects;

	//bi-directional many-to-one association to EmplAddress
	@OneToMany(mappedBy="empInformation",fetch =FetchType.EAGER , cascade = CascadeType.ALL )
	private Set<EmplAddress> employeeAddress;

	public EmpInformation() {
	}

	public String getEmpId() {
		return this.empId;
	}

	public void setEmpId(String empId) {
		this.empId = empId;
	}

	public byte getActive() {
		return this.active;
	}

	public void setActive(byte active) {
		this.active = active;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getEmpFirstName() {
		return this.empFirstName;
	}

	public void setEmpFirstName(String empFirstName) {
		this.empFirstName = empFirstName;
	}

	public String getEmpLastName() {
		return this.empLastName;
	}

	public void setEmpLastName(String empLastName) {
		this.empLastName = empLastName;
	}

	public String getEmpMiddleName() {
		return this.empMiddleName;
	}

	public void setEmpMiddleName(String empMiddleName) {
		this.empMiddleName = empMiddleName;
	}

	public byte getLoginAttempts() {
		return this.loginAttempts;
	}

	public void setLoginAttempts(byte loginAttempts) {
		this.loginAttempts = loginAttempts;
	}

	public String getManager() {
		return this.manager;
	}

	public void setManager(String manager) {
		this.manager = manager;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getSecondryEmail() {
		return this.secondryEmail;
	}

	public void setSecondryEmail(String secondryEmail) {
		this.secondryEmail = secondryEmail;
	}

	 

	public Set<Project> getProjects() {
		return this.projects;
	}

	public void setProjects(Set<Project> projects) {
		this.projects = projects;
	}

	public Set<EmplAddress> getEmployeeAddress() {
		return this.employeeAddress;
	}

	public void setEmployeeAddress(Set<EmplAddress> employeeAddress) {
		this.employeeAddress = employeeAddress;
	}

}